import datetime
import decimal

from pydantic import BaseModel, Field
from typing import Optional, List


class HomeStatsSum(BaseModel):
    driver_num: Optional[int] = Field(None, comment='驾驶员数量')
    car_num: Optional[int] = Field(None, comment='车辆数量')
    device_num: Optional[int] = Field(None, comment='设备数量')


class MyTime(BaseModel):
    start_time: Optional[datetime.datetime] = Field(None, comment='开始时间')
    end_time: Optional[datetime.datetime] = Field(None, comment='结束时间')


class HomeStatsSumToday(BaseModel):
    today_mileage: Optional[float] = Field(None, comment='今日里程')
    yesterday_mileage: Optional[float] = Field(None, comment='昨日里程')
    before_mileage: Optional[float] = Field(None, comment='前日里程')
    today_car_start: Optional[int] = Field(None, comment='今日出车')
    yesterday_car_start: Optional[int] = Field(None, comment='昨日出车')
    before_car_start: Optional[int] = Field(None, comment='前日出车')
    today_car_free: Optional[int] = Field(None, comment='今日空闲车辆')
    yesterday_car_free: Optional[int] = Field(None, comment='昨日空闲车辆')
    before_car_free: Optional[int] = Field(None, comment='前日空闲车辆')
    today_order_agent: Optional[int] = Field(None, comment='今日待办任务')
    yesterday_order_agent: Optional[int] = Field(None, comment='昨日待办任务')
    before_order_agent: Optional[int] = Field(None, comment='前日待办任务')
    today_order_dsh: Optional[int] = Field(None, comment='今日待审批任务')
    yesterday_order_dsh: Optional[int] = Field(None, comment='昨日待审批任务')
    before_order_dsh: Optional[int] = Field(None, comment='前日待审批任务')
    today_order_ddd: Optional[int] = Field(None, comment='今日待调度任务')
    yesterday_order_ddd: Optional[int] = Field(None, comment='昨日待调度任务')
    before_order_ddd: Optional[int] = Field(None, comment='前日待调度任务')
    today_order_ywj: Optional[int] = Field(None, comment='今日待结算任务')
    yesterday_order_ywj: Optional[int] = Field(None, comment='昨日待结算任务')
    before_order_ywj: Optional[int] = Field(None, comment='前日待结算任务')

class OrderStartAndMileage(BaseModel):
    scale_time: Optional[datetime.datetime] = Field(None, comment='时间')
    driver_num: Optional[int] = Field(None, comment='驾驶员数量')
    car_num: Optional[int] = Field(None, comment='车辆数量')
    device_num: Optional[int] = Field(None, comment='设备数量')



class MyAgentSum(BaseModel):
    dsh_num: Optional[int] = Field(None, comment='用车代办')
    ddd_num: Optional[int] = Field(None, comment='车务代办')
    js_num: Optional[int] = Field(None, comment='结算代办')
    sum_num: Optional[int] = Field(None, comment='总代办')

class CarKanban(BaseModel):
    not_use_num: Optional[int] = Field(None, comment='不可用')
    free_num: Optional[int] = Field(None, comment='空闲')
    use_num: Optional[int] = Field(None, comment='已出车')

class DriverKanban(BaseModel):
    free_num: Optional[int] = Field(None, comment='空闲')
    use_num: Optional[int] = Field(None, comment='已出车')